import config from "@/config"
import http from "@/utils/request"

export default {
	menu: {
		myMenus: {
			url: `${config.API_URL}/menus/my`,  ///1.6.1
			name: "获取我的菜单",
			get: async function (params) {
				return await http.get(this.url, params);
			}
		},
		list: {
			url: `${config.API_URL}/menus/list`,
			name: "菜单管理-获取菜单",
			get: async function () {
				return await http.get(this.url);
			}
		},
		post: {
			url: `${config.API_URL}/menus`,
			name: "修改菜单",
			post: async function (params) {
				return await http.post(this.url, params, {
					headers: {
						//'response-status': 401
					}
				});
			}
		},
		delete: {
			url: `${config.API_URL}/menus`,
			name: "删除菜单",
			delete: async function (params) {
				return await http.delete(this.url, params, {
					headers: {
						//'response-status': 401
					}
				});
			}
		}
	},
	dic: {
		tree: {
			url: `${config.API_URL}/dics/tree`,
			name: "获取字典树",
			get: async function () {
				return await http.get(this.url);
			}
		},
		list: {
			url: `${config.API_URL}/dics/list`,
			name: "字典明细",
			get: async function (params) {
				return await http.get(this.url, params);
			}
		},
		listBycode: {
			url: `${config.API_URL}/dics/listbycode`,
			name: "字典明细按code查询",
			get: async function (params) {
				return await http.get(this.url, params);
			}
		},
		get: {
			url: `${config.API_URL}/system/dic/get`,
			name: "获取字典数据",
			get: async function (params) {
				return await http.get(this.url, params);
			}
		},
		dictKey: { //增加修改字典dic
			url: `${config.API_URL}/dics/key`,
			name: "修改字典",
			post: async function (params) {
				return await http.post(this.url, params, {
					headers: {
						//'response-status': 401
					}
				});
			}
		},
		dictKeyDel: { //增加修改字典dic
			url: `${config.API_URL}/dics/key`,
			name: "修改字典",
			delete: async function (params) {
				return await http.delete(this.url, params, {
					headers: {
						//'response-status': 401
					}
				});
			}
		},
		dicValue: { //增加修改字典值value
			url: `${config.API_URL}/dics/value`,
			name: "修改字典值",
			post: async function (params) {
				return await http.post(this.url, params, {
					headers: {
						//'response-status': 401
					}
				});
			}
		},
		dictValueDel: { //增加修改字典dic
			url: `${config.API_URL}/dics/value`,
			name: "修改字典",
			delete: async function (params) {
				return await http.delete(this.url, params, {
					headers: {
						//'response-status': 401
					}
				});
			}
		},
	},
	role: {
		list: {
			url: `${config.API_URL}/roles/list`,
			name: "获取角色列表",
			get: async function (params) {
				return await http.get(this.url, params);
			}
		},
		listall: {
			url: `${config.API_URL}/roles/listall`,
			name: "获取全部角色列表下拉框",
			get: async function (params) {
				return await http.get(this.url, params);
			}
		},
		post: {
			url: `${config.API_URL}/roles`,
			name: "修改角色列表",
			post: async function (data) {
				return await http.post(this.url, data, {
					headers: {
						//'response-status': 401
					}
				});
			}
		},
		delete: {
			url: `${config.API_URL}/roles`,
			name: "删除角色",
			delete: async function (data) {
				return await http.delete(this.url, data, {
					headers: {
						//'response-status': 401
					}
				});
			}
		},
		permission: {
			url: `${config.API_URL}/roles/permission`,
			name: "修改角色的权限清单",
			put: async function (data) {
				return await http.put(this.url, data, {
					headers: {
						//'response-status': 401
					}
				});
			}
		},
		rolepermission: {
			url: `${config.API_URL}/permissions`,
			name: "根据RoldId获取permission",
			get: async function (data) {
				return await http.get(this.url, data, {
					headers: {
						//'response-status': 401
					}
				});
			}
		}
	},
	dept: {
		list: {
			url: `${config.API_URL}/depts/list`,
			name: "获取部门列表",
			get: async function (params) {
				return await http.get(this.url, params);
			}
		},
		post: {
			url: `${config.API_URL}/depts/post`,
			name: "修改列表",
			post: async function (data) {
				return await http.post(this.url, data, {
					headers: {
						//'response-status': 401
					}
				});
			}
		},
		delete: {
			url: `${config.API_URL}/depts`,
			name: "删除部门",
			delete: async function (data) {
				return await http.delete(this.url, data, {
					headers: {
						//'response-status': 401
					}
				});
			}
		}
	},
	user: {
		all: {
			url: `${config.API_URL}/users/all`,
			name: "获取所有用户",
			get: async function (params) {
				return await http.get(this.url, params);
			}
		},
		tree: {
			url: `${config.API_URL}/users/tree`,
			name: "获取所有用户",
			get: async function (params) {
				return await http.get(this.url, params);
			}
		},
		list: {
			url: `${config.API_URL}/users/list`,
			name: "获取用户分页列表",
			get: async function (params) {
				return await http.get(this.url, params);
			}
		},
		post: {
			url: `${config.API_URL}/users`,
			name: "修改用户",
			post: async function (data) {
				return await http.post(this.url, data, {
					headers: {
						//'response-status': 401
					}
				});
			}
		},
		delete: {
			url: `${config.API_URL}/users`,
			name: "删除列表",
			delete: async function (data) {
				return await http.delete(this.url, data, {
					headers: {
						//'response-status': 401
					}
				});
			}
		},
		resetpassword: {
			url: `${config.API_URL}/users/resetpassword`,
			name: "重置密码",
			put: async function (data) {
				return await http.put(this.url, data, {
					headers: {
						//'response-status': 401
					}
				});
			}
		}
	},
	app: {
		list: {
			url: `${config.API_URL}/system/app/list`,
			name: "应用列表",
			get: async function () {
				return await http.get(this.url);
			}
		}
	},
	log: {
		list: {
			url: `${config.API_URL}/logs/list`,
			name: "日志列表",
			get: async function (params) {
				return await http.get(this.url, params);
			}
		}
	},
	table: {
		list: {
			url: `${config.API_URL}/system/table/list`,
			name: "表格列管理列表",
			get: async function (params) {
				return await http.get(this.url, params);
			}
		},
		info: {
			url: `${config.API_URL}/system/table/info`,
			name: "表格列管理详情",
			get: async function (params) {
				return await http.get(this.url, params);
			}
		}
	},
	tasks: {
		list: {
			url: `${config.API_URL}/system/tasks/list`,
			name: "系统任务管理",
			get: async function (params) {
				return await http.get(this.url, params);
			}
		}
	},
	device: {
		all: {
			url: `${config.API_URL}/devices/all`,
			name: "获取所有设备",
			get: async function (params) {
				return await http.get(this.url, params);
			}
		},
		list: {
			url: `${config.API_URL}/devices/list`,
			name: "获取设备分页列表",
			get: async function (params) {
				return await http.get(this.url, params);
			}
		},
		post: {
			url: `${config.API_URL}/devices`,
			name: "修改设备",
			post: async function (data) {
				return await http.post(this.url, data, {
					headers: {
						//'response-status': 401
					}
				});
			}
		},
		delete: {
			url: `${config.API_URL}/devices`,
			name: "删除设备",
			delete: async function (data) {
				return await http.delete(this.url, data, {
					headers: {
						//'response-status': 401
					}
				});
			}
		},
	},
	//预警告警
	alert: {
		list: {
			url: `${config.API_URL}/alerts/list`,
			name: "报警预警列表",
			get: async function (params) {
				return await http.get(this.url, params);
			}
		},
		track: {
			url: `${config.API_URL}/alerts/track`,
			name: "报警预警处置操作",
			post: async function (params) {
				return await http.post(this.url, params);
			}
		}

	},
	message: {
		list: {
			url: `${config.API_URL}/order/msgList`,
			name: "获取消息",
			get: async function (params) {
				return await http.get(this.url, params);
			}
		},
		sendMsg: {
			url: `${config.API_URL}/order/sendMsg`,
			name: "发送消息",
			post: async function (params) {
				return await http.post(this.url, params);
			}
		},
		sendMsgToDept: {
			url: `${config.API_URL}/order/sendMsgToDept`,
			name: "发送消息",
			post: async function (params) {
				return await http.post(this.url, params);
			}
		},
		markRead: {
			url: `${config.API_URL}/order/markRead`,
			name: "标记已读",
			post: async function (params) {
				return await http.post(this.url, params);
			}
		},
		// maoyuan
		msgList: {
			url: `${config.API_URL}/messages/list`,
			name: "获取消息",
			get: async function (params) {
				return await http.get(this.url, params);
			}
		},
	}
}
